<include file="Public:header"/>		
<div id="content">
	<div id="content-header">
		<h1>栏目列表</h1>
		<div class="btn-group">
			<a href="{:U('Admin/Tag/index')}" class="btn btn-large" title="新增栏目"><i class="fa fa-file"></i></a>
		</div>
	</div>
	<div id="breadcrumb">
		<a href="#" title="回到首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
		<a href="#" class="current">栏目列表</a>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<div class="widget-box">
				<div class="widget-title">
					<span class="icon">
						<i class="fa fa-tags"></i>
					</span>
					<h5>栏目列表</h5>
					<span class="label label-info">{$num} 条 </span>
				</div>
				<div class="widget-content">
					<table class="table table-bordered table-striped table-hover ">
						<thead>
							<tr>
								<th width="5%">栏目编号</th>
								<th width="20%">栏目名称</th>
								<th width="20%">描述</th>
								<th width="20%">添加时间</th>
								<th width="10%">是否显示</th>
								<th width="10%">操作</th>
							</tr>
						</thead>
						<tbody>
							<volist name="list" id="k">
							<tr>
								<td class="id">{$k.t_id}</td>
								<td>{$k.t_name}</td>
								<td>{$k.t_remark|msubstr=0,120,'utf-8',true}</td>
								<td>{$k.t_time|getTime}</td>
								<td>
									<switch name="k['t_view']">
										<case value="0"><span class=" btn-dark-red btn-xs">不显示</span></case>
										<case value="1"><span class=" btn-dark-green btn-xs">显示</span></case>
										<default />暂无数据
									</switch>
								</td>
								<td>
									<a class="btn btn-success btn-sm" href="{:U('/Admin/Tag/tagEdit',array('id'=>$k['t_id']))}">编辑</a>&nbsp;&nbsp;
									<button class="btn btn-danger btn-sm deltag">删除</button>
								</td>
							</tr>
							</volist>
						</tbody>
					</table>
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<include file="Public:footer"/>
	<script>	
	$(document).ready(function(){
		$(".deltag",this).click(function(){
			var id = $(this).parents("tr").find(".id").text();
			$(".deltag").attr("disabled",true);
			$.ajax({
				type:"post",
				url:"/Admin/Tag/tagDel",
				async:true,
				data:{"id":id},
				success:function(data){
					if(data.error==0){
						succ("完成!",data.msg,"__SELF__");
					}else{
						err("错误!",data.msg);
						$(".deltag").removeAttr('disabled');
					}
				},
			});
		});
	});
	</script>
</body>
</html>
